//
//  THSideDragView.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, THSidePosition) {
    THSidePositionTop,
    THSidePositionLeft,
    THSidePositionBottom,
    THSidePositionRight
};

@class THSideDragView;
@protocol THSideDragViewDelegate <NSObject>

@optional
- (void)sideDragViewDidShow:(THSideDragView *)sideDragView;

- (void)sideDragViewDidHide:(THSideDragView *)sideDragView;

- (void)sideDragViewDidHide:(THSideDragView *)sideDragView causedByGesture:(BOOL)causedByGesture;

- (void)sideDragView:(THSideDragView *)sideDragView showAmountChanged:(CGFloat)showAmount;

- (BOOL)shoundDragOutSideDragView:(THSideDragView *)sideDragView;

@end

@interface THSideDragView : UIView

@property (weak,nonatomic) id<THSideDragViewDelegate> delegate;

@property (readonly,nonatomic) UIView * contentView;

@property (weak,readonly,nonatomic) UIView * customizeView;

@property (readonly,nonatomic) THSidePosition position;

@property (nonatomic) BOOL canDragOut;
//默认YES
@property (nonatomic) BOOL enableTapGesture;
//默认YES
@property (nonatomic) BOOL enablePanGesture;

@property (copy,nonatomic) NSString * screenID;
//整体显示视图 默认为[UIApplication sharedApplication].keyWindow
@property (weak, nonatomic) UIView * displayView;

@property (strong ,nonatomic) UIView * blurView;

@property (readonly,nonatomic) UIView * alphaView;

//整体显示区域 默认为[UIScreen mainScreen].bounds
@property (nonatomic) CGRect displayFrame;
//防止手势冲突 默认为NO
@property (nonatomic) BOOL preventGestureConflict;
//禁用spring动画
@property (nonatomic) BOOL disableSpringAnimation;

@property (nonatomic) CGFloat safeAreaInsetsBottom;

- (instancetype)initWithCustomizeView:(UIView *)view position:(THSidePosition)position;

- (instancetype)initWithCustomizeView:(UIView *)view position:(THSidePosition)position noSafeArea:(BOOL)noSafeArea;

+ (void)setSafeAreaBottomColor:(UIColor *)color;

- (void)setSafeAreaBottomColor:(UIColor *)color;

- (void)showInView:(UIView *)view animated:(BOOL)animated;

- (void)show:(BOOL)animated;

- (void)hide:(BOOL)animated;

- (BOOL)isDisplay;

- (void)setMaskerColor:(UIColor *)color;
//刷新显示 会重新计算CustomizeView大小
- (void)refreshDisplay:(BOOL)animated;
//圆角 未开启blur效果时有效
- (void)setHeaderCornerRadius:(CGFloat)radius;

@end

NS_ASSUME_NONNULL_END
